/*
 * RandomNumber.h
 *
 *  Created on: Jan 15, 2012
 *      Author: luiz
 */

#ifndef RANDOMNUMBER_H_
#define RANDOMNUMBER_H_

#include <time.h>
#include <stdlib.h>

class RandomNumber
{
private:
    RandomNumber(long seed);
    static RandomNumber *instance;
public:
    virtual ~RandomNumber();
    static RandomNumber & get_instance(int seed=0)
    {
        if(!instance) {
            instance = new RandomNumber(seed);
        }
        return *instance;
    }

    int getRandomInteger(int between=100);
    double getRandonDouble();

    static void change_seed(long new_seed);

    static void delete_instance();
};

#endif /* RANDOMNUMBER_H_ */
